package com.qf.openapi.zuul.feign;

import com.qf.qfsy.vo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

@FeignClient("openapi-cache")
public interface CacheFeignClient {

    @RequestMapping("/cache/set/{key}/{value}/{seconds}")
    public R setwithTTl(@PathVariable("key") String key
            ,@PathVariable("value") String value
            ,@PathVariable("seconds") Long seconds);

    @RequestMapping("/cache/get/{key}")
    public R get(@PathVariable("key") String key);

    @RequestMapping("/cache/keys/{keypattern}")
    public R keys(@PathVariable("keypattern") String keypattern);

    @RequestMapping("/cache/hmget/{key}")
    public R hmget(@PathVariable("key") String key);

    @RequestMapping("/cache/hmset/{key}")
    public R hmset(@PathVariable("key") String key, @RequestBody Object value);


    @GetMapping("/cache/set/{key}/{value}")
    public R set(@PathVariable("key") String key,@PathVariable("value") String value);
}
